(function(clazz,id){
	var grid;
	var classdat = Get("/clazz/name/"+clazz).obj;
	var columns = _("task.fun.getColumns")(classdat.fields); 
	var callback = function(clazz,pid){
		var data = _("task.fun.getData")(clazz);
		Ext.getCmp(pid).store.loadData(data);
	}
	
	columns.push({
		xtype: 'actioncolumn',
        text:"查看",  flex:1,
        items: [{
        	icon: "lib/ext/shared/icons/fam/grid.png",
            tooltip: "修改",
            handler: function(grid, rowIndex, colIndex) {
            	_("task.add.panel")(clazz,id,callback,grid.store.getAt(rowIndex).data);
            }
        }] 
	});
	/*
	columns.push({
		xtype: 'actioncolumn',
		text:"删除",  flex:1,
        items: [{
        	icon: "lib/ext/shared/icons/fam/delete.gif",
            tooltip: "删除",
            handler: function(grid, rowIndex, colIndex) {
            	_("entity.delete.onepanel")(clazz,id,callback,grid.store.getAt(rowIndex).data);
            }
        }] 
	});*/
	
	
	grid = {
		xtype		:	'gridpanel',
        id			:   id,
    	autoScroll	:	true,
        selModel	:	Ext.create('Ext.selection.CheckboxModel'),
        columns 	:	columns ,
        listeners   : {
        	show:function(){
        		//alert("sdf");
        		callback(clazz,id);
        		setCurrentClass(clazz);
        	}
        },
        viewConfig    : {
            getRowClass : function(record,rowIndex,rowParams,store){
            	//log(record.data);
            	if(record.data.processVariables["节点状态"]=="红灯")
            		return "x-grid-red";
            	if(record.data.processVariables["节点状态"]=="绿灯")
            		return "x-grid-record-green";
            	if(record.data.processVariables["节点状态"]=="黄灯")
            		return "x-grid-record-yellow";
            	return null;
                 /*if(record.data.status == '3' || record.data.status == '7' || record.data.status == '8'){     //正常关闭、责任人原因中止、发起人原因中止 
                          return 'x-grid-record-red';
                 }
                if(record.data.status == '2' || record.data.status == '5' || record.data.status == '6'){
                          return 'x-grid-record-yellow';
                }
                if(record.data.status == '1' || record.data.status == '4'){
                         return 'x-grid-record-green';
                }*/
           }
        }
	};
	grid["tbar"]	=	_("task.fun.getTbar")(clazz,id,callback);
	grid["store"]	=	_("task.fun.getStore")(clazz);
	return grid;
})